/*
 * @Descripttion: 
 * @Author: ziwei
 * @Date: 2022-08-28 20:31:25
 * @LastEditors: ziwei
 * @LastEditTime: 2022-08-28 20:50:19
 */
var clients = [];
onconnect = function(e) {
  var port = e.ports[0];
  clients.push(port);
  port.addEventListener("message", function(e) {
    for (var i = 0; i < clients.length; i++) {
      var eElement = clients[i];
      eElement.postMessage(e.data);
    }
  });
  port.start();
};